/******************************************************************
 * Created by: DO HOANG HAI                                       
 * Date of Creation: 26th/Sep/2007              
 * Date of last modification: 26th/Sep/2007
 *                                                                
 * Description: This class describes composite objects of resulting
 * item which match the search criteria
 * 
 * Status: Optimized and Finished
 ******************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using Pbdms.Common.DataObject;

namespace Pbdms.Common.DataObject
{
    /// <summary>
    /// Represent a result from searching function
    /// </summary>
    [System.Xml.Serialization.XmlInclude(typeof(FileInfo))]
    [System.Xml.Serialization.XmlInclude(typeof(Comment))]
    public class ResultItem
    {
        /// <summary>
        /// indicates that the source of this result item is from local database
        /// </summary>
        public const int ITEM_SOURCE_LOCAL = 0;
        /// <summary>
        /// indicates that the source of this result item is from the network
        /// </summary>
        public const int ITEM_SOURCE_NETWORK = 1;

        private Item itemObj;
        private FileInfo fileInfoObj;
        private Comment commentObj;
        private double matchPercentage = 0;
        private int sourceOfItem = 0;

        /// <summary>
        /// get and set the item object attribute
        /// </summary>
        public Item ItemObj
        {
            get { return itemObj; }
            set { itemObj = value; }
        }
        
        /// <summary>        
        /// if the file is in another computer, the location should be the ip address     
        /// </summary>
        public FileInfo FileInfoObj
        {
            get { return fileInfoObj; }
            set { fileInfoObj = value; }
        }
        /// <summary>
        /// get and set the source of the item
        /// </summary>
        public int SourceOfItem
        {
            get { return sourceOfItem; }
            set { sourceOfItem = value; }
        }
        /// <summary>
        /// get and set Comment object attribute
        /// </summary>
        public Comment CommentObj
        {
            get { return commentObj; }
            set { commentObj = value; }
        }        
        /// <summary>
        /// get and set the matching percentage attribute
        /// </summary>
        public double MatchPercentage
        {
            get { return matchPercentage; }
            set { matchPercentage = value; }
        }
        
    }
}
